package com.dragon.modules.yuegou.mapper.points;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dragon.modules.yuegou.entity.points.DetailEntity;
import com.dragon.modules.yuegou.model.points.Detail;
import com.dragon.modules.yuegou.query.points.PointDetailQuery;
import com.dragon.modules.yuegou.query.points.PointSumQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

/**
 * 积分获取明细 Mapper接口
 *
 * @author pbuilder generated
 * @date 2019-04-02 17:40:47
 * @version 2.0
 */
@Component("ptDetailMapper")
public interface DetailMapper extends BaseMapper<DetailEntity> {

    /***
     * 查询所有按商圈和用户id分组
     * @return
     */
    List<Detail> searchTheAll();

    /**
     * 积分记录分页列表
     * */
    IPage<Detail> searchDetail(IPage page,@Param("query") PointDetailQuery query);

    /**
     * 导出积分记录
     * */
    List<Detail> searchDetail(@Param("query") PointDetailQuery query);

    /**
     * 获取指定商圈下指定用户id的累计积分
     * @param query
     * @return
     */
    BigDecimal getSumPointsByMemberId(@Param("query") PointSumQuery query);

}
